//
//  WKTitleButton.m
//  WKDemo
//
//  Created by wangzhaohui-Mac on 14-8-14.
//  Copyright (c) 2014年 com.app. All rights reserved.
//

#import "WKTitleButton.h"

@implementation WKTitleButton

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.titleLabel.font = [UIFont systemFontOfSize:10];
        //按钮标题显示模式

        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        [self setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
    
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat titleX = 0;
    CGFloat titlelH = 20;
    CGFloat titleY =  self.height - titlelH;
    CGFloat titleW = self.width;
    self.titleLabel.frame = CGRectMake(titleX, titleY, titleW, titlelH);
    
    
//    self.imageView.origin = CGPointMake(0, titleY - titlelH);
    
    self.imageView.centerX = self.titleLabel.centerX;
    self.imageView.y = titleY - titlelH;
}


@end
